<?php
namespace Home\Controller;
/**
 */
class SoftwareController extends HomeController {

	//系统首页
    public function index(){
    	$map ['name'] = '名品宜家';
    	$minScore = M('Softwareversion')->where($map)->max(version);
    	$map ['version'] = $minScore;
    	$list=M('Softwareversion')->where($map)->select();
    	$this->assign("data",$list[0]);
        $this->display();
    }
    
    public function getLatestVersion($appversion=null)
    {
    	$map ['name'] = '名品宜家';
    	$map ['version'] = array('gt',$appversion);
    	$minScore = M('Softwareversion')->where($map)->max(version);
    	if(count($minScore)>0)
    	{
    		$map ['version'] = $minScore;
    		$list=M('Softwareversion')->where($map)->select();
    		$responce->data=$list[0];
    		$responce->status=true;
    	}else 
    	{
    		$responce->status=false;
    	}
    	$this->ajaxReturn(json_encode($responce));
    }
}